package net.wanho.ems.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import net.wanho.ems.entity.Emp;
import net.wanho.ems.mapper.EmpMapper;
import net.wanho.ems.service.EmpService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Author：汤小洋
 * Date：2023-07-11 16:58
 * Description：<描述>
 */
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = Exception.class)
public class EmpServiceImpl implements EmpService {

    private final EmpMapper empMapper;

    @Override
    public PageInfo<Emp> list(Integer page, Integer limit, Emp emp) {
        PageHelper.startPage(page,limit);
        List<Emp> list = empMapper.selectList(emp);
        return new PageInfo<>(list);
    }
}
